#pragma once

#include "serial.hpp"
#include <stdint.h>

#define ROBOT_CMD_BUF_LEN 9
#define ROBOT_CMD_HEADER 0xff

class Robot
{
public:
	Robot(const char* port, int baudrate = 115200);
	virtual ~Robot();
	int  connect();
	void release();
	void cmd(uint8_t fb, uint8_t lr, uint8_t rotate, uint8_t pan, uint8_t tilt, uint8_t fire);
	
protected:
	Serial serial;
	uint8_t cbuf[ROBOT_CMD_BUF_LEN];
};
